#include <iostream>

using namespace std;

int main()
{
    int T,n,x,k;
    int a[50];
    cin>>T;
    while(T--)
    {
        cin>>n;
        k=0;x=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            if(a[i]!=1)
            {
                k++;
            }
            x^=a[i];
        }
        if(!k)
        {
            if(n%2==0) cout<<"John"<<endl;
            else cout<<"Brother"<<endl;
        }
        else
        {
            if(x)cout<<"John"<<endl;
            else cout<<"Brother"<<endl;
        }
    }
    return 0;
}
